import { provide ,inject} from 'midway';
import { IAccount, IGetAccount,IAccountService} from '../interface';
import { EntityManager } from '../lib/db';

@provide('accountService')
export class AccountService implements IAccountService {
  constructor(
    @inject() private readonly em: EntityManager,
  ) {
  }
  /**
   * 新增
   * @param user 用户实体
   */
// async insertUser(options:IInsertUser):Promise<number | undefined> {
//   return  this.em.db('users').insert(options).returning('id');
// }
async getAccount(options:IGetAccount):Promise<IAccount | undefined>{
  return this.em.db('account').where(options);
}
}
